<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8" />

	<title>广州市澳凯家具有限公司</title>
	<meta name="keywords" content="家具，设计，广州市澳凯">
	<meta name="description" content="致力於引領辦公家具潮流的廣州市澳凱家具有限公司是一家集專業研發設計，生產製造，銷售與服務於一體的現代企業，工廠座落於享有中國家具之都之稱的廣州市。">
	<meta name='author' content='网站建设：智杰科技'>
	<meta name='viewport' content='width=1440' />
	<meta http-equiv="Cache-Control" content="no-transform" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	<link href="./css/build/public.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="./css/build/news.css">

</head>

<body>
	<div class="main pagebox">
		<div class="nav-wrap" id="publicNav"></div>
		<div id="c_breadcrumb_nav-15320486657336245" class="c_breadcrumb_nav-02001">
			<div class="e_box e_box-000 p_breadcrumbList" data-ename="面包屑导航">
				<div class="e_breadcrumb e_breadcrumb-001 p_breadcrumbFirst ">
					<a href="/">
						<div class="font">
							<i class="iconfont before"></i>
							<span><span class="i_homePage">首页</span></span>
						</div>
					</a>
				</div>
				<div class="e_title e_GuideLabel-001 p_end  ">
					<div class="font"><i class="iconfont"></i><span class="i_separator">&gt;</span></div>
				</div>



				<div class="e_breadcrumb e_breadcrumb-000 p_breadcrumbCurrent">
					<div class="font">
						<i class="iconfont before"></i>
						<span>新闻中心</span>
						<i class="iconfont after"></i>
					</div>
				</div>

			</div>
		</div>
		<div id="c_news_list-15203846544659086" class="c_news_list-53002">
			<div class="e_stylebox e_ContentMajorStyleBox-001 p_stylebox" id="">
				<div class="stylebox_top">
					<div class="stylebox_title">
						<h2 class="title_main">新闻中心</h2>
					</div>
				</div>
				<div class="stylebox_top_line"></div>
				<div class="stylebox_content">

					<!-- 新闻列表DOM开始 -->
					<div class="news_two">
						<ul class="news_two_ul" id="div_news"></ul>
						<div class="e_box e_OccupyBox-001 p_OccupyBox">
							<div class="e_pagebox e_pagebox-000 p_page" id="pageBox"></div>
							<div class="clearBoth"></div>
						</div>
					</div>
					<!-- 新闻列表DOM结束 -->
				</div>
				<div class="stylebox_bottom_line"></div>
				<div class="stylebox_bottom">
				</div>
			</div>
		</div>
	</div>
	<div class="footer-wrap" id="publicFooter"></div>
	<script src="js/jquery.min.js"></script>
	<script src="./js/public.js"></script>
	<script>
		var isIntPage =false;
		function getNewsList(page) {
			$.ajax({
				type: 'POST',
				url: ajaxUrlObj['GET_NEWS_LIST'],
				data: {
					page: page,
					rows: 4
				},
				success: function (rep) {
					if (typeof rep === 'string') {
						rep = JSON.parse(rep)
					}
					if (rep.code == 1) {
						var data = JSON.parse(rep.data)
						var list = data.rows
						var str = ''
						if(!isIntPage){
							isIntPage =true;
							intPage(data.total, 4)
						}
						for (var i = 0, l = list.length; i < l; i++) {
							str+='<li> <div class="news_two_box wow slideInUp" style="visibility: visible; animation-name: slideInUp;"> <a href="new_detail.html?id='+list[i].id+'" target="false" class="news_two_img"> <img src="'+host+list[i].informationImage+'"> </a> <a href="new_detail.html?id='+list[i].id+'" class="news_two_txt"> <span>'+list[i].informationTitle+'</span> <i>'+list[i].informationDescribe+'</i> </a> <p class="news_two_date"> <span> '+list[i].createTime+' </span> </p> <a href="new_detail.html?id='+list[i].id+'" class="ser_but news_two_but"><i><span class="i_buttontext">查看详情</span></i></a> </div> </li>'
						}
						$("#div_news").html(str)
					}
				},
				error: function (error) {
					console.log(error)
				}
			});
		}

		function intPage(total, pageSize) {
			var page = Math.ceil(total / pageSize)
			var str = '<div class="pre"><div class="font"><i class="iconfont"></i><span class="i_pre">上一页</span></div></div><div class="pageNum active">1</div>'
			for(var i =2;i<=page;i++){
				str+='<div class="pageNum">'+i+'</div>'
			}
			$("#pageBox").html(str+'<div class="next" data-all="'+page+'"> <div class="font"> <i class="iconfont"></i><span class="i_next" >下一页</span> </div> </div>')
			$("#pageBox .pre").on("click",function(){
				var page = parseInt($("#pageBox .active").html())
				if (page <= 1) return
				$("#pageBox .active").removeClass('active')
				$("#pageBox .pageNum").eq(page-2).addClass('active')
				getNewsList(page-1)
			})
			$("#pageBox .next").on("click",function(){
				var page = parseInt($("#pageBox .active").html())
				var all = $(this).attr("data-all")
				if (page >= all) return
				$("#pageBox .active").removeClass('active')
				$("#pageBox .pageNum").eq(page).addClass('active')
				getNewsList(page+1)
			})
			$("#pageBox .pageNum").on("click", function(){
				var $this=$(this)
				if($this.hasClass('active')) return
				$("#pageBox .active").removeClass('active')
				$this.addClass('active')
				getNewsList(parseInt($this.html()))
			})
		}
		$(window).ready(function(){
			getNewsList(1)
		})
	</script>
</body>

</html>